package me.yushuai.wukong.base.repository;

import me.yushuai.wukong.base.entity.PackingBasic;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.Optional;

/**
 * @author zhoushuai@189.cn
 * @since 2022-08-18
 */
@Repository
public interface PackingBasicRepository extends JpaRepository<PackingBasic, Long>, JpaSpecificationExecutor<PackingBasic> {

    @Query("from PackingBasic where bizId = ?1")
    boolean existsByBizId(String bizId);

    @Query("from PackingBasic where bizId =?1")
    Optional<PackingBasic> findByBizId(String key);

}




